package collection.hash;

import org.junit.Test;

import java.util.Collections;
import java.util.IdentityHashMap;

/**
 * Created mangcao with 2019/2/20 14:54
 * Description:
 */
public class IdentityHashMapTest {

    @Test
    public void Test(){

        IdentityHashMap<String, String> idMap = new IdentityHashMap<>();

        idMap.put("1", "a");
        idMap.put("2", "a");
        idMap.put("1", "c");
        System.out.println(idMap);

//        Runtime.halt(1);
        Runtime.getRuntime().halt(1);

        Collections.synchronizedMap(idMap);

        System.out.println(idMap);
        System.out.println(idMap);
        System.out.println(idMap);
        System.out.println(idMap);

    }

}
